Skip to content

Fix XCom edit modal value not repopulating on reopen.#62798

Open
Arbaaz123676 wants to merge 2 commits intoapache:mainfrom
Arbaaz123676:fix/xcom-edit-modal-value-not-populating
Open

Fix XCom edit modal value not repopulating on reopen.#62798
Arbaaz123676 wants to merge 2 commits intoapache:mainfrom
Arbaaz123676:fix/xcom-edit-modal-value-not-populating

Conversation

@Arbaaz123676
Copy link

@Arbaaz123676 Arbaaz123676 commented Mar 3, 2026

Summary

This PR fixes an issue where the XCom value was not displayed when reopening the edit modal after updating it.

Root Cause

The modal lifecycle and query behavior caused stale or skipped state updates when reopening the modal, leading to an empty value field.

Changes

  • Removed lazyMount from the dialog to ensure proper unmount/remount behavior.
  • Enabled refetch on mount for the XCom entry query.
  • Adjusted the population effect to rely on data instead of data?.value !== undefined.
  • Ensured query invalidation for both GetXcomEntries and GetXcomEntry after update.

Result

The XCom edit modal now consistently repopulates the latest value when reopened.

Fixes #61486

@boring-cyborg boring-cyborg bot added the area:UI Related to UI/UX. For Frontend Developers. label Mar 3, 2026
Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to fix the problem for me and some pieces of the change set seems irrelevant. (also CI need fixing)

Screen.Recording.2026-03-05.at.17.38.11.mov

Can you double check or eventually provide a recording of this scenario working on your end?

Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As requested above you didn't provide more context (screenshot, explanation).

Part of the code change seem unrelated to the PR and looks like fully AI generated without any human double checking.

Closing the PR. Please do not re-open unless you are willing to actually spend the time needed to manually test this before asking for a review.

Comment on lines +117 to +132
onSuccess: async (response) => {
queryClient.setQueryData(
[
useXcomServiceGetXcomEntryKey,
{
dagId,
dagRunId: runId,
deserialize: true,
mapIndex,
stringify: false,
taskId,
xcomKey,
},
],
response,
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we changing this? Doesn't seem related.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This updates the Query cache for a Airflow XCom entry using the API response after a successful request, so the UI updates immediately without refetching from the server.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This manually query setting is also incorrect. The response.value is always a string even if it is a date or json object.

@Arbaaz123676
Copy link
Author

Screen.Recording.2026-03-10.at.6.19.02.AM.mov

@pierrejeambrun It is working good on my end

@bbovenzi bbovenzi reopened this Mar 11, 2026
@bbovenzi
Copy link
Contributor

Looks to work. Let's just undo the onSuccess callback changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

XCom value is not populating on edit operation

3 participants